package com.awesomeproject;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import butterknife.ButterKnife;

/**
 * Created by TP on 2016/12/7.
 * activity的基类
 */

public abstract class MyBaseActivity extends AppCompatActivity {
    public abstract int getViewId();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getViewId());
        ButterKnife.bind(this);
        initVariables();
        loadData();
        initView(savedInstanceState);
    }
    protected abstract void initVariables();
    protected abstract void initView(Bundle savedInstanceState);
    protected abstract void loadData();
}